<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>鼓励金</title>
    <script src="__INDEX__/js/mui.min.js"></script>
	<link href="__INDEX__/css/mui.min.css" rel="stylesheet" />
	<link rel="stylesheet" href="__INDEX__/css/iconfont.css" />
	<link rel="stylesheet" href="__INDEX__/css/style.css" />
	<link rel="stylesheet" href="__INDEX__/css/mall.css" />	
	<script type="text/javascript" src="__INDEX__/dist/jquery.min.js" ></script>
	<script type="text/javascript" src="__INDEX__/js/menudown.js" ></script>
</head>
<body>
	<div class="mui-content">
		<div class="list_fenlnav clearfix">
			<div class="mask"></div>
			<dl class="topmenu">
				<dt>
					<div class="selectlist">
						<div class="select_textdiv">
							<input type="hidden" value=""/>
							<p class="s_text">
								<span class="s_xznr">时间</span>
								<span class="iconfont icon-jiantou"></span>
							</p>
						</div>
						<div class="select_textul">
							<ul class="select_first_ul">
								<li data-type=1 data-id=0>
									<p>全部</p>
								</li>
								<li data-type=1 data-id=1>
									<p>本周</p>
								</li>
								<li data-type=1 data-id=2>
									<p>本月</p>
								</li>
							</ul>
						</div>
					</div>	
				</dt>
				<dt>
					<div class="selectlist">
						<div class="select_textdiv">
							<input type="hidden" value=""/>
							<p class="s_text">
								<span class="s_xznr">类型</span>
								<span class="iconfont icon-jiantou"></span>
							</p>
						</div>
						<div class="select_textul">
							<ul class="select_first_ul">
								<li data-type=2 data-id=0>
									<p>全部</p>
								</li>
								<li data-type=2 data-id=1>
									<p>收入</p>
								</li>
								<li data-type=2 data-id=2>
									<p>支出</p>
								</li>
							</ul>
						</div>
					</div>	
				</dt>
			</dl>				
		</div>
	    <div class="glj_top">
	    	<p class="glj_zsnum">{$info_user.score}</p>
	    	<p>鼓励金余额</p>
	    	<!--<p class="gljt_btnbox">
	    		<a href="{:url('member/glj_cz')}">充值</a>
	    		<a href="{:url('member/glj_zz')}" class="special">转账</a>
	    	</p>-->
	    </div>
	    <div class="glj_bt">鼓励金明细</div>
	    <ul class="record_list2">
	    	
	    </ul>
	
	    <div class="glj_bbtnbox" id="btn">
	    	<!--<a href="{:url('member/glj_tixian')}">兑现</a>-->
	    	<a href="{:url('member/glj_cz')}">充值</a>
    		<!--<a href="{:url('member/glj_zz')}" class="special">转账</a>-->
	    </div>
	</div>
	<input type="hidden" id="time_tp" value="0" />
	<input type="hidden" id="score_tp" value="0" />
	<input type="hidden" id="page" value="1" />
</body>
</html>
	{include file="public/footer" /}
<script src="__PUBLIC__/static/js/mui.min.js"></script>
<script>
	$(".select_textul li").click(function(){
		var type=$(this).data('type');
		var v=$(this).data("id");
		if(type==1){
			$("#time_tp").val(v);
		}else if(type==2){
			$("#score_tp").val(v);
		}
		$("#page").val(1);
		get_data();
	})
	get_data();
	function get_data(){
			$.ajax({
			type:"post",
			data:{
				time_tp:$("#time_tp").val(),
				score_tp:$("#score_tp").val(),
				page:$("#page").val()
			},
			url:"{:url('index/member/get_scores')}",
			success:function(data){	
				var list=data.list;
				var html="";
				if(list){
					for(var i=0;i<list.length;i++){
						var log=list[i];
						html+='<li class="clearfix">'+
					    		'<div class="left">'+
									'<p class="list_nam">'+log.message+'</p>'+
									'<p class="list_time">'+log.add_time+'</p>'+
								'</div>'+
					    		'<div class="right" style="color: #D6AA50;">'+log['balance']+'</div>'+
				    		   '</li>';
					}
				}else{
					html="没有记录";
				}
				$(".record_list2").html(html);
				
			}
		});
	}
	$(window).scroll(function(){
		var scrollTop = $(window).scrollTop();       //滚动条高度
		var bodyheight = $(document).height();         //文档的高度
		var windowheight = window.innerHeight;	//$(window).height();              //当前窗体的高度
		if((bodyheight - windowheight - scrollTop) == 0){
			$.ajax({
			type:"post",
			data:{
				time_tp:$("#time_tp").val(),
				score_tp:$("#score_tp").val(),
				page:parseFloat($("#page").val())+1
			},
			url:"{:url('index/member/get_scores')}",
			success:function(data){	
				var list=data.list;
				var html="";
				if(list){
					$("#page").val(parseFloat($("#page").val())+1);
					for(var i=0;i<list.length;i++){
						var log=list[i];
						html+='<li class="clearfix">'+
					    		'<div class="left">'+
									'<p class="list_nam">'+log.message+'</p>'+
									'<p class="list_time">'+log.add_time+'</p>'+
								'</div>'+
					    		'<div class="right" style="color: #D6AA50;">'+log['balance']+'</div>'+
				    		   '</li>';
					}
				}else{
					html="已经到最后";
				}
				$(".record_list2").append(html);
				
			}
		});
		
		}				
	})
	
</script>
